package com.hqd.ch03.v13.config;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.LinkedList;
import java.util.List;

@Data
public class ConstructorArgumentValues {
    private List<ValueHolder> constructorValues = new LinkedList<>();

    public void addConstructorValue(ValueHolder valueHolder) {
        this.constructorValues.add(valueHolder);
    }

    @AllArgsConstructor
    @NoArgsConstructor
    @Data
    public static class ValueHolder {
        private String name;
        private String value;
        private boolean ref;
        private int index;

        public ValueHolder(int index, String value) {
            this.value = value;
            this.index = index;
            this.ref = false;
        }

        public ValueHolder(String name, String value) {
            this.name = name;
            this.value = value;
            this.ref = false;
        }
    }
}
